﻿using BasicLoggerModule.Model;
using log4net.Repository.Hierarchy;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BasicLoggerModule.Service
{
    public class ProductService : IProductService
    {
        public ILogger<ProductService> logger { get; set; }
        public ProductService(ILogger<ProductService> logger)
        {
            this.logger = logger;
        }

        public void Run()
        {
            string xx = logger.GetType().Name;
            try
            {
                throw new Exception("xxxxx");
            }
            catch (Exception ex)
            {
                //logger.LogInfo($"wwwwxxxx{ex.StackTrace}");
                logger.LogInformation($"wwwwxxxx{ex.StackTrace}  {ex.Message}");
                //Microsoft.Extensions.Logging.Logger<ProductService> xx = new Logger<ProductService>();
                //LoggerFactory
            }
        }

    }
}
